<?php

use App\Services\Utils\TimeHelper;
use Faker\Generator as Faker;

/** @var \Illuminate\Database\Eloquent\Factory $factory */
$factory->define(\App\Models\Coupon\CouponTicket::class, function (Faker $faker) {
    
    return [
        'code'          => TimeHelper::microTimeSerial(),
        'customer_id'   => 0,
        'title'         => $faker->title,
        'desc'          => $faker->sentence,
        'discount'      => $faker->randomFloat(2, 1, 90),
        'price_min'     => $faker->numberBetween(20, 1000),
        'is_available'  => \App\Models\Coupon\CouponTicket::IS_AVAILABLE,
        'discount_type' => \App\Models\Coupon\CouponTicket::DISCOUNT_TYPE_NUM,
        'started_at'    => now()->subDay(),
        'ended_at'      => now()->addDay(),
        'expired_in'    => 10,
        'expire_type'   => \App\Models\Coupon\CouponTicket::EXPIRE_TYPE_RANGE,
    ];
});
